
/**
 * Project Name:cats-zcjc
 * File Name:Station.java
 * Package Name:com.catsic.zcjc.entity
 * Date:2017年10月26日下午4:24:18
 * Copyright (c) 2017, oa.catsic.com All Rights Reserved.
 */
 
package com.catsic.zcjc.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import com.catsic.base.BaseEntity;
import com.catsic.core.entity.Organ;


/**
 * ClassName: Station
 * Description: 站点实体类
 * date: 2017年10月26日 下午4:24:18
 * author: xietiebing
 */
@Entity
@Table(name="T_STATION")
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Station extends BaseEntity implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 5438624297067060419L;

	/**
	 * name:设备名称
	 */
	@Column(name="NAME",nullable=false)
	private String name;
	
	/**
	 * code:设备编号
	 */
	@Column(name="CODE",nullable=false)
	private String code;
	

	/**
	 * type:类型
	 */
	@Column(name="TYPE")
	private Integer type;
	
	/**
	 * latitude:经度
	 */
	@Column(name="LATITUDE")
	private Double latitude;
	
	/**
	 * longitude:纬度
	 */
	@Column(name="LONGITUDE")
	private Double longitude;
	
	/**
	 * CITYCODE:区县
	 */
	@ManyToOne(fetch = FetchType.LAZY,optional = false)
	@JoinColumn(name="CITYCODE",referencedColumnName = "ID")
	private District cityCode;
	
	/**
	 * address:详细地址
	 */
	@Column(name="ADDRESS")
	private String address;
	
	/**
	 * remark:备注
	 */
	@Column(name="REMARK")
	private String remark;
	
	/**
	 * status:状态
	 */
	/*
	@Column(name="STATUS")
	private Integer status=0;*/
	
	/**
	 * organ:所属机构
	 */
	@ManyToOne(fetch = FetchType.LAZY,optional = false)
	@JoinColumn(name="OID",referencedColumnName = "ID")
	private Organ organ;
	
	/**
	 * equips:设备
	 */
	@OneToMany(cascade=CascadeType.REMOVE,fetch = FetchType.LAZY,mappedBy="station") 
    private List<Equip> equips;
	
	/**
	 * systems:系统
	 */
	@OneToMany(cascade=CascadeType.REMOVE,fetch = FetchType.LAZY,mappedBy="station") 
    private List<System> systems;
	
	/**
	 * typeSon:子类型
	 */
	@Column(name="TYPE_SON")
	private String typeSon;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getTypeSon() {
		return typeSon;
	}

	public void setTypeSon(String typeSon) {
		this.typeSon = typeSon;
	}

	public Double getLatitude() {
		return latitude;
	}

	public void setLatitude(Double latitude) {
		this.latitude = latitude;
	}

	public Double getLongitude() {
		return longitude;
	}

	public void setLongitude(Double longitude) {
		this.longitude = longitude;
	}

	public District getCityCode() {
		return cityCode;
	}

	public void setCityCode(District cityCode) {
		this.cityCode = cityCode;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Organ getOrgan() {
		return organ;
	}

	public void setOrgan(Organ organ) {
		this.organ = organ;
	}

	
	public List<Equip> getEquips() {
		return equips;
	}

	public void setEquips(List<Equip> equips) {
		this.equips = equips;
	}

	
	public List<System> getSystems() {
		return systems;
	}

	public void setSystems(List<System> systems) {
		this.systems = systems;
	}

	@Override
	public String toString() {
		return "Station [name=" + name + ", code=" + code + ", type=" + type + ", latitude=" + latitude + ", longitude="
				+ longitude + ", cityCode=" + cityCode + ", address=" + address + ", remark=" + remark  + ", organ=" + organ + "]";
	}
	

	
}
